﻿using Cngot.Extensions.EventBus;
using Microsoft.Extensions.DependencyInjection;
using System;

namespace Cngot.Extensions.DependencyInjection
{
    public static class EventBusExtensions
    {
        public static IServiceCollection AddEventBus(this IServiceCollection services, Action<EventBusProvider> configure)
        {
            var eb = new EventBusProvider(services);
            //services.AddSingleton(sp => eb);

            configure.Invoke(eb);

            return services;
        }
    }
}
